Query Builder HTC - Demo Page

The Query Builder HTC lets users build queries easily and intuitively. This page demonstrates its basic functionality. It also includes a basic description of the Query Builder's programmatic interface.


Demo

Loading the Query Builder...

Set the Query Builder's edit-mode:
Edit a query.
View a query.

Current Query XML:

 


events

onReady
Indicates that the Query Builder is fully loaded and initialized, and that its programmatic interface is ready to use. Any app that intends to interact with the Query Builder's programmatic interface should ensure that they do this AFTER this event fires.

event object properties

none

onActive
This event fires when the Query Builder finally enters the active state after Activate() has been called. The reason for this event is that activation may fail if one or more of the XML files this control depends on cannot be found. This event is particularly useful when the Query Builder is being used inside of another UI-widget that cannot itself enter an activated state until all subcomponents have successfully activated.

event object properties

none

onError
This event fires when activation of the Query Builder fails at any point. Keep in mind that the Activate method may return a success value, but an onError event later fires as well because some unexpected error takes place as activation continues. No error message is returned with the event, but if the Query Builder is in debug mode, an error is displayed to the user before the event fires.

event object properties

none

onQueryChange
This event fires when the current query body changes. Things that cause this event to fire are the addition or modification of a query clause, or the deletion of one or more query clauses.

event object properties

none

methods

bSuccess = divQueryBldr.Activate(bEdit)
Activates the Query Builder.

parameters

bEdit (Required) Boolean. If true, the displayed query may be modified by the user. If false, the query is displayed read-only.

return value

bSuccess Boolean. If a fatal error occurs during this function's operation, returns false. Otherwise it returns true.

divQueryBldr.Deactivate()
Deactivates the Query Builder and disables all controls.

parameters

none

return value

none

remarks

Note that this does not clear the current query from the Query Builder.

arProfileList = divQueryBldr.GetProfileList()
Returns a list of the names of all profiles that are currently loaded into the Query Builder.

parameters

none

return value

arProfileList VBScript SAFEARRAY. Array of profile names.

bSuccess = divQueryBldr.SetExprBody(sExpr)
Loads the query represented by sExpr into the Query Builder.

parameters

sExpr (Required) String. Contains XML defining a valid query.

return value

bSuccess Boolean. Returns false if parsing of the expression-body fails. Returns true if parsing of the expression-body succeeds.

remarks

An empty string or Null can be passed in to clear the current query.

bSuccess = divQueryBldr.SetExprBodyXML(xmlExpr)
Loads the query represented by xmlExpr into the Query Builder.

parameters

xmlExpr (Required) Microsoft.XMLDOM. XML defining a valid query.

return value

bSuccess Boolean. Returns false if parsing of the expression-body fails. Returns true if parsing of the expression-body succeeds.

remarks

A value of Nothing can be passed in to clear the current query.

sExpr = divQueryBldr.GetExprBody()
Returns the current expression body.

parameters

none

return value

sExpr String. Contains the XML of the current expression body.

remarks

If there isn't currently any query, this function returns Null.

xmlExpr = divQueryBldr.GetExprBodyXML()
Returns the current expression body.

parameters

none

return value

xmlExpr Microsoft.XMLDOM. Contains the current expression body.

remarks

If there isn't currently any query, this function returns Null.

divQueryBldr.SetExprListXML(xmlExprList)
Allows the caller to give the Query Builder a set of expressions that the Query Builder can use to build other expressions. This will almost never be used when the Query Builder is being used by itself. The Expression Builder uses this function to hand the Query Builder a list of expressions.

parameters

xmlExprList (Required) Microsoft.XMLDOM. XML defining a list of expressions.

return value

none

remarks

Passing Nothing as the argument will simply cause the Query Builder to not allow the user to insert existing expressions into the current expression.

container attributes (set on element)

XMLConfigID ID of an XML data-island from which the Query Builder can load its configuration information.
AutoActivate If true, the Query Builder automatically activates upon completion of loading. The Query Builder is activated in edit-mode.

scriptable properties

bReady = divQueryBldr.IsReady
Indicates whether the Query Builder is ready or not. This property is false before the onReady event fires, and is true after the onReady event fires. It is provided so that external components can determine if the Query Builder is ready to be used without using events.
bActive = divQueryBldr.IsActive
Indicates whether the Query Builder is currently active or not. This property is true when the Query Builder is active (ie. the user can interact with the Query Builder) and false when it is inactive.

Configuration XML

KEY:     <NodeTag>     <RepeatingNodeTag*>     @attribute

sample

<XML ID="xmlisConfig">
  <EBCONFIG>
    <DEBUG />
    <EXPR-ASP>/retailbizdesk/exprarch</EXPR-ASP>
    <SITE-TERMS URL='SiteTerms.xml' />
    <PROFILE-LIST>
      <PROFILE SRC="NonUPMProfDefs.asp" />
      <PROFILE>Profile Definitions.UserObject</PROFILE>
    </PROFILE-LIST>
    <EEE-INTRINSICS />
    <ADVANCED />
  </EBCONFIG>
</XML>